#include"ManageGame.h"
#include "gamemap.h"
#include "time.h"

static time_t lastTimeRun = 0;
//This file has all the juice and bones for the game
//this file will update render and load levels
//going to have the logic
void ManageGame::Update()
{
	time_t currentTime = clock();	// the number of ms since hte program started
	doQueue();
//	UpdateSound();
	HandleMessages();
	GUI::Engine()->Update();
	getMap()->update((int)(currentTime-lastTimeRun));
	lastTimeRun = currentTime;
}
//going to do all the drawing stuff
void ManageGame::RenderGame()
{
	pGraphics->Render();
}

void ManageGame::loadLevel(int)
{
	pMap = new GameMap();//new BaseObject();
	pMap->init(point(12,12), point(64,64), "Resources\\art\\Level_1.bmp");

	pMap->addToDisplayList();

}
//loads the level the same 
void ManageGame::updateLevel()
{

}

//this is if you want a cutscence or something cool going on during each level
//probably wont get to thou
void ManageGame::transition()
{

}

void ManageGame::UpdateSound()
{
	// TODO read a list of sounds that should be playing, and play them
	//soundMgr.playSoundLoop(1);
	
}